Skip to content

Conversation

@IvanPuntev
Copy link
Contributor

@IvanPuntev IvanPuntev commented Nov 20, 2025

Fix #242
Fix #305
Obsolete #306

@IvanPuntev
Copy link
Contributor Author

@SlyngDK Please review.

 # dependency-version: 0.8.14
 # dependency-type: direct:development
 # update-type: version-update:semver-patch
 # dependency-version: 0.8.14
 # dependency-type: direct:production
 # update-type: version-update:semver-patch

 # dependency-version: 3.29.0
 # dependency-type: direct:production
 # update-type: version-update:semver-minor
 # dependency-version: 3.29.0
 # dependency-type: direct:production
 # update-type: version-update:semver-minor
 # dependency-version: 3.29.0
 # dependency-type: direct:production
 # update-type: version-update:semver-minor
 # dependency-version: 3.29.0
 # dependency-type: direct:production
 # update-type: version-update:semver-minor
 # dependency-version: 3.29.0
 # dependency-type: direct:production
 # update-type: version-update:semver-minor
 # dependency-version: 3.29.0
 # dependency-type: direct:development
 # update-type: version-update:semver-minor
  #dependency-version: 3.29.0
 # dependency-type: direct:development
@IvanPuntev IvanPuntev force-pushed the provide-external-jackson-object-mapper branch from 099fc28 to 1f915cc Compare November 21, 2025 11:22
@IvanPuntev
Copy link
Contributor Author

@SlyngDK Should we use a single json factory instance instead of creating new one for each build step?

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a quick look and spotted a few things.

Comment on lines +33 to +36
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>yasson</artifactId>
</dependency>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you enforcing Yasson now? It doesn't look like an improvement?

Copy link
Contributor Author

@IvanPuntev IvanPuntev Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The jsonb factory initialization is now moved from the processor (deployment) to the recorder (runtime) and it is instantiated only on demand. The dependency is added because the native build starts to break without it. It is not present in the runtime classpath unless you explicitly depend on it.

Error: Discovered unresolved type during parsing: org.eclipse.yasson.internal.JsonBindingBuilder. This error is reported at image build time because class io.quarkiverse.loggingjson.jsonb.JsonbJsonFactory is registered for linking at image build time by command line and command line.

Comment on lines +8 to +18
@Singleton
public class ObjectMapperProvider {

@Inject
ObjectMapper mapper;

public ObjectMapper get() {
return this.mapper;
}

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt this will work well in practice as you want logging very early, even before ArC is set up.

If you require ArC to be set up to set up logging, it might work but you will collect lots of messages and buffer them in memory before the setup is fully done.

I think you probably need to use the ServiceLoader for this and my guess is that you won't be able to reuse the common ObjectMapper.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to be able to get the object mapper provided from the project including the extension. Don't think the ServiceLoader will do...

Copy link
Contributor Author

@IvanPuntev IvanPuntev Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arc usage should be ok since it is already used in the same recorder https://github.com/quarkiverse/quarkus-logging-json/blob/main/runtime/src/main/java/io/quarkiverse/loggingjson/LoggingJsonRecorder.java#L57 Also the processor build steps are marked as @record(ExecutionTime.RUNTIME_INIT)

Comment on lines -22 to +21
final Config.FieldConfig config = fieldConfig(Optional.empty(), Optional.empty());
final Config.FieldConfig config = fieldConfig(null, null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not a very good idea to mix changes that are not really related to the issue at hand. It makes the PR very verbose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm aware of that but I considered these changes harmless and since there is no frequent activity in this repo decided to include them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants